/** @jsx createElement */
import {Button, Navigator, Page} from 'weex-nuke';
import {createElement, Component, render} from 'rax';

let App = class NukeDemoIndex extends Component {
    constructor() {
        super();
    }

    linkToWeex() {
        Navigator.push(
            '#home',
            '下个页面标题'
        );
    }

    linkToLocal() {
        Navigator.pop();
    }

    linkToH5() {
        Navigator.push('https://m.taobao.com');
    }

    mailto = () => {
        Navigator.push('mailto:yichen.hww@alibaba-inc.com');
    };
    sms = () => {
        Navigator.push('sms:10086');
    };
    tel = () => {
        Navigator.push('tel:10086');
    };
    system = () => {
        Navigator.push('https://m.baidu.com', '', true, {
            method: 'browser',
            target: '_blank'
        });
    };

    render() {
        var self = this;

        return (
            <Page title="Navigator">
                <Page.Intro main="nav"/>
                <Button onPress={() => {
                    Navigator.push(
                        '#nav',
                        'nav'
                    );
                }} block="true" type="primary">
                    nav
                </Button>
                <Page.Intro main="tab"/>
                <Button onPress={() => {
                    Navigator.push(
                        '#tab',
                        'tab'
                    );
                }} block="true" type="primary">
                    tab
                </Button>
                <Page.Intro main="list"/>
                <Button onPress={() => {
                    Navigator.push(
                        '#list',
                        'list'
                    );
                }} block="true" type="primary">
                    list
                </Button>
                {/*<Page.Intro main="pop"/>*/}
                {/*<Button onPress={this.linkToLocal} block="true" type="primary">*/}
                    {/*跳转*/}
                {/*</Button>*/}
                {/*<Page.Intro main="跳转到h5页面"/>*/}
                {/*<Button onPress={this.linkToH5} block="true" type="primary">*/}
                    {/*跳转到淘宝h5*/}
                {/*</Button>*/}
                {/*<Page.Intro main="发邮件"/>*/}
                {/*<Button type="primary" block="true" onPress={this.mailto}>*/}
                    {/*navigator发邮件*/}
                {/*</Button>*/}
                {/*<Page.Intro main="发短信"/>*/}
                {/*<Button type="primary" block="true" onPress={this.sms}>*/}
                    {/*navigator发短信*/}
                {/*</Button>*/}
                {/*<Page.Intro main="打电话"/>*/}
                {/*<Button type="primary" block="true" onPress={this.tel}>*/}
                    {/*navigator打电话*/}
                {/*</Button>*/}
                {/*<Page.Intro main="test"/>*/}
                {/*<Button type="primary" block="true" onPress={this.system}>*/}
                    {/*test*/}
                {/*</Button>*/}
            </Page>
        );
    }
};
export default App;
